--
-- Author: mm
-- Date: 2018-04-17 15:06:49
--
-- HandbookModel
-- 指南相关数据管理器

local fileName = string.getModeName(...)
local ClassRef = class(fileName, app.mvc.ModelBase)
local DirectoryChallengeVo = import("..models.DirectoryChallengeVo")

function ClassRef:ctor(data)
    self.super.ctor(self, data)
end

function ClassRef:init()
    self._directoryChallengeInfo = nil
end

--我要变强相关--
function ClassRef:reqGetDirectoryChallengeInfo()
    app.session:request("pb_activity.C2S_GetDirectoryChallengeInfo", {}, function(msg)
        --dump(msg.info)
        self._directoryChallengeInfo = DirectoryChallengeVo.new(msg.info)
        app:sendMsg("HandbookController", "refreshDirectoryChallengePanel", self._directoryChallengeInfo)
    end)
end

function ClassRef:reqBuyDirectoryChallengeAward()
    app.session:request("pb_activity.C2S_GetDirectoryChallengeLVReward", {}, function(msg)
        --dump(msg)
        if msg.ok and self._directoryChallengeInfo then
            self._directoryChallengeInfo:init(msg.info)
            app:sendMsg("HandbookController", "refreshDirectoryChallengePanel", self._directoryChallengeInfo)
        end
    end)
end
return ClassRef
